﻿<Window x:Name="HlavniOkno" x:Class="Rezervace.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Rezervace" Height="515" Width="713" WindowStartupLocation="CenterScreen" PreviewTextInput="HlavniOkno_PreviewTextInput">
    <Window.Resources>
        
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0,2,40,2" />
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <DockPanel LastChildFill="true">
                            <Border Background="OrangeRed" DockPanel.Dock="right" Margin="5,0,0,0" 
                                Width="20" Height="20" CornerRadius="5"
                                ToolTip="{Binding ElementName=customAdorner, 
                                          Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                                <TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" 
                                   FontWeight="Bold" Foreground="white" />
                            </Border>
                            <AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
                                <Border BorderBrush="red" BorderThickness="1" />
                            </AdornedElementPlaceholder>
                        </DockPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
    </Window.Resources>
    <Grid x:Name="grid_1">
        <Label Content="Poznámky:" HorizontalAlignment="Left" Margin="414,29,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.213,0.769"/>
        <Label Content="Jméno:" HorizontalAlignment="Left" Margin="187,29,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.213,0.769"/>
        <TextBox x:Name="tb_Jmeno" HorizontalAlignment="Left" Height="23" Margin="239,29,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="148" TabIndex="2"
                 Validation.Error="Validation_Error" Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=Jmeno, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"/>
        <Label Content="Příjmení:" HorizontalAlignment="Left" Margin="178,55,0,0" VerticalAlignment="Top"/>
        <TextBox x:Name="tb_Prijmeni" HorizontalAlignment="Left" Height="23" Margin="239,57,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="148" TabIndex="3"
                 Validation.Error="Validation_Error" Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=Prijmeni, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"/>
        <ListView x:Name="list_SeznamZbozi" HorizontalAlignment="Left" Height="245" Margin="31,178,-163,-104" VerticalAlignment="Top" Width="649" SelectionMode="Single">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="100" Header="Kód" DisplayMemberBinding="{Binding CarovyKod}"/>
                    <GridViewColumn Width="260" Header="Název" DisplayMemberBinding="{Binding Nazev}"/>
                    <GridViewColumn Width="110" Header="Od dne" DisplayMemberBinding="{Binding OdDne, StringFormat=dd-MM-yyyy}"/>
                    <GridViewColumn Width="60" Header="Na dobu" DisplayMemberBinding="{Binding PocetDni}"/>
                    <GridViewColumn Width="110" Header="Ke dni" DisplayMemberBinding="{Binding KeDni, StringFormat=dd-MM-yyyy}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button x:Name="bt_OK" Content="Rezervovat" HorizontalAlignment="Left" Margin="488,440,0,0" VerticalAlignment="Top" Width="99" RenderTransformOrigin="1.107,-1.65" FontSize="16" FontWeight="Bold" Click="bt_OK_Click"/>
        <Button x:Name="bt_Storno" Content="Storno" HorizontalAlignment="Left" Margin="605,440,0,0" VerticalAlignment="Top" Width="75" FontSize="16" Click="bt_Storno_Click"/>

        <Image HorizontalAlignment="Left" Height="66" Margin="31,7,0,0" VerticalAlignment="Top" Width="68" Source="Obrazky/clock.png"/>
        
        <Button x:Name="bt_PridatDoSeznamu" HorizontalAlignment="Left" Margin="31,143,0,0" VerticalAlignment="Top" Width="106" RenderTransformOrigin="1.107,-1.65" Height="30" ClickMode="Press" TextOptions.TextFormattingMode="Display" Click="bt_PridatDoSeznamu_Click">
            <Grid Width="93">
                <Image HorizontalAlignment="Left" Source="Obrazky/add.png" Margin="0,5,0,5" Width="21"/>
                <Label HorizontalAlignment="Right" Content="Přidat nové" FontWeight="Bold" Width="81" Margin="0,0,-9,0"/>
            </Grid>
        </Button>
        <Button x:Name="bt_Upravit" HorizontalAlignment="Left" Margin="518,143,0,0" VerticalAlignment="Top" Width="80" RenderTransformOrigin="1.107,-1.65" Height="30" Grid.Column="1" TextOptions.TextFormattingMode="Display" Click="bt_Upravit_Click">
            <Grid Width="80">
                <Image HorizontalAlignment="Left" Source="Obrazky/edit.png" Margin="5,5,0,5" Width="21"/>
                <Label HorizontalAlignment="Right" Content="Upravit" FontWeight="Bold" Width="58"/>
            </Grid>
        </Button>
        <Button x:Name="bt_Smazat" HorizontalAlignment="Left" Margin="605,143,0,0" VerticalAlignment="Top" Width="75" RenderTransformOrigin="1.107,-1.65" Height="30" FontWeight="Bold" TextOptions.TextFormattingMode="Display" Click="bt_Smazat_Click">
            <Grid Width="80">
                <Image HorizontalAlignment="Left" Source="Obrazky/delete.png" Margin="5,5,0,5" Width="21"/>
                <Label HorizontalAlignment="Right" Content="Smazat" FontWeight="Bold" Width="58"/>
            </Grid>
        </Button>
        <GroupBox Header="Rezervace" HorizontalAlignment="Left" Margin="104,7,0,0" VerticalAlignment="Top" Height="122" Width="576" Foreground="#FF226E91" FontWeight="Bold" FontSize="14">
            <TextBox HorizontalAlignment="Left" Height="95" TextWrapping="Wrap"
                     VerticalAlignment="Top" Width="193" Margin="373,0,-2,0" FontWeight="Normal" FontSize="12" FontStyle="Italic"/>
        </GroupBox>

    </Grid>
</Window>
